import App from 'app';
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import Preloader from 'components/preloader';
import Fallback from 'components/fallback';
import Application from './application';
import { createRoot } from 'react-dom/client';
import { HashRouter } from 'react-router-dom';

// Detection
const os = App.system.name;
const version = App.system.version;
const isTrash =
    (App.isIE && !App.isEdge) || // at least edge
    !App.hasWebGL ||
    App.isWindowsPhone ||
    App.isAndroidTablet ||
    (os == 'android' && parseFloat(version) < 6.9) ||
    (os == 'ios' && parseFloat(version) < 10.3);

// console.log(App, 'App');
// let mountPoint = document.createElement('div');
// mountPoint.classList.add('Entry', 'fsr');
// document.body.appendChild(mountPoint);

// Mounting
// App.useAS = App.isDesktop;
App.useAS = false;

if (App.useAS) {
    document.body.classList.add('hide-scrollbar');
}

// ReactDOM.render(
//     <BrowserRouter>
//         <Application />
//     </BrowserRouter>,
//     document.querySelector('.Application')
// );

const container = document.querySelector('.Application');
const root = createRoot(container);
root.render(
    // <BrowserRouter>

    //     <Application />
    // </BrowserRouter>

    <HashRouter>
        <Application />
    </HashRouter>
);

// For fusion document
window.React = React;
